package com.example.demo.entity;

import common.ReturnInfoEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @ClassName:ResultEntity
 * @Description:
 * @Author:Deamer
 * @Date:2020/3/30 18:59
 **/
@NoArgsConstructor
@AllArgsConstructor
@Data
public class ResultEntity {
    private int code;
    private String msg;
    private Object data;

    public ResultEntity(ReturnInfoEnum returnInfoEnum) {
        this.code = returnInfoEnum.getCode();
        this.msg = returnInfoEnum.getMessage();
    }

    public ResultEntity(ReturnInfoEnum returnInfoEnum, Object data) {
        this.code = returnInfoEnum.getCode();
        this.msg = returnInfoEnum.getMessage();
        this.data = data;
    }
}
